﻿<Window x:Class="LockCrypt.WinSynchronize"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:LockCrypt"
    xmlns:l49ui="clr-namespace:Lime49.UI;assembly=Lime49"
    xmlns:lex="http://schemas.root-project.org/xaml/presentation"
    WindowStartupLocation="CenterOwner"
    Title="{lex:LocText LockCrypt.Core:Strings:Synchronize}" Height="400" Width="500"
    Loaded="Window_Loaded"
    Style="{StaticResource {x:Type Window}}" Icon="/LockCrypt;component/Resources/LockCrypt.ico">
    <Window.CommandBindings>
        <CommandBinding Command="loc:LockCryptCommands.Synchronize" Executed="Synchronize" CanExecute="IsDeviceConnected"/>
    </Window.CommandBindings>
    <Grid Margin="6" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        
        <Label Grid.Row="0" Grid.Column="0" Content="{lex:LocText LockCrypt.Core:Strings:DatabaseOnDevice}"/>
        <TextBox Grid.Row="0" Grid.Column="1" x:Name="txtDevicePath" />
        
        <Label Grid.Row="1" Grid.Column="0" Content="{lex:LocText LockCrypt.Core:Strings:LocalDatabase}"/>
        <TextBox Grid.Row="1" Grid.Column="1" x:Name="txtLocalPath" IsEnabled="False"/>
        
        <GroupBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Header="{lex:LocText LockCrypt.Core:Strings:Icons}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Label Grid.Row="0" Grid.Column="0" Content="{lex:LocText LockCrypt.Core:DeviceSync:IconPathOnDevice}"/>
                <TextBox Grid.Row="0" Grid.Column="1" x:Name="txtIconsDevice" />
                
                <CheckBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="chkIncludeIcons" IsChecked="True" Content="{lex:LocText LockCrypt.Core:Strings:IncludeIcons}"/>
            </Grid>
        </GroupBox>
        
        <l49ui:ImageButton x:Name="btnSync" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" MinWidth="100" IsDefault="True" 
                         Image="pack://application:,,,/Resources/images/refresh_16.png" ImageLocation="Left" Text="{lex:LocText LockCrypt.Core:Strings:Synchronize}" Command="loc:LockCryptCommands.Synchronize" />
        <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center">
            <l49ui:ImageButton x:Name="btnToDevice" MinWidth="100" 
                             Image="pack://application:,,,/Resources/images/arrow_forward_16.png" ImageLocation="Left" Text="{lex:LocText LockCrypt.Core:Strings:CopyToDevice}" Command="loc:LockCryptCommands.Synchronize" />
            <l49ui:ImageButton x:Name="btnFromDevice" MinWidth="100" 
                             Image="pack://application:,,,/Resources/images/arrow_back_16.png" ImageLocation="Left" HorizontalAlignment="Center" Text="{lex:LocText LockCrypt.Core:Strings:CopyFromDevice}" Command="loc:LockCryptCommands.Synchronize" />
        </StackPanel>
        
        <RichTextBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" IsReadOnly="True" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Visible" x:Name="txtProgress">
            <FlowDocument>
                <Paragraph>
                    <Span />
                </Paragraph>
            </FlowDocument>
        </RichTextBox>
    </Grid>
</Window>
